package com.sth.cloud.controller;


import com.sth.cloud.entities.Order;
import com.sth.cloud.resp.ResultData;
import com.sth.cloud.service.OrderService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: 司天宏
 * @Description:
 * @Date: 2024-04-14 13:27
 */
@RestController
@Tag(name = "创建订单", description = "创建订单")
public class OrderController {
    @Resource
    private OrderService orderService;

    /**
     * 创建订单
     */
    @GetMapping("/order/create")
    @Operation(summary = "创建订单", description = "创建订单")
    public ResultData create(Order order) {
        orderService.create(order);
        return ResultData.success(order);
    }
}
